package com.neuresys.database.databaseimpl.jssqlite;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.typedarrays.client.Uint8ArrayNative;
import com.neuresys.database.databaseapi.Connection;
import com.neuresys.database.databaseapi.Database;

public final class SQLite extends JavaScriptObject implements Connection {

	protected SQLite()
	{
		
	}
	
	/* (non-Javadoc)
	 * @see com.neuresys.database.databaseimpl.jssqlite.Connection#close()
	 */
	public native final void close()
	/*-{
	this.close();
}-*/;
	/* (non-Javadoc)
	 * @see com.neuresys.database.databaseimpl.jssqlite.Connection#exec(java.lang.String)
	 */
	public final JSONObject exec(String sql)
	{
		return new JSONObject(exec0(sql));
	}
	 
	 
	private native final JavaScriptObject exec0(String s)
	/*-{
	 return this.exec(s);
}-*/;
	/* (non-Javadoc)
	 * @see com.neuresys.database.databaseimpl.jssqlite.Connection#getDatabase()
	 */
	private native final Uint8ArrayNative getDatabase0()
	/*-{
		
	 return this.exportData();
}-*/;
	public Uint8ArrayNative getDatabase()
	{
		return getDatabase0();
	}

	
	 
}
